home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
pcxkit.exe
/
SHOWCGA.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-10-24
|
1KB
|
45 lines
program SHOWCGA;
(* Sample implementation of PCX.TPU for CGA. You need to have the
Turbo .BGI files in the current directory, or change Initgraph.
Enter a valid filename (without extension) on the command line
or, if you're running under Turbo, in the Parameters box.
For 4-color images in the standard colors, just change Grmode to CGAC1 *)
uses GRAPH, DOS, CRT, PCX;
var grdriver, grmode: integer;
textpage0: byte absolute $b800:0000;
textsave: pointer;
cursorx, cursory: byte;
begin
clrscr;
pcxfilename:= paramstr(1) + '.PCX';
grdriver:= cga; grmode:= cgahi; { 2-color 640x200 format }
read_pcx_file(grdriver, pcxfilename);
if file_error then
begin
writeln('File ', fexpand(pcxfilename), ' not found.');
halt;
end;
writeln('This is a text screen, which we will save and restore.');
writeln;
write('Strike any key. ');
cursorx:= wherex; cursory:= wherey;
getmem(textsave, 4000);
move(textpage0, textsave^, 4000); { Save text screen }
repeat until readkey <> #1;
initgraph(grdriver, grmode, ''); { Initialize graphics }
move(buff0^, screenbuff0, 8000); { Display the image }
move(buff1^, screenbuff1, 8000);
repeat until readkey <> #1;
closegraph;
move(textsave^, textpage0, 4000); { Restore text screen }
gotoxy(cursorx, cursory);
freemem(textsave, 4000);
repeat until readkey <> #1;
clrscr;
end.